#pragma once

#include "simple_factory/OperationAdd.hpp"
#include "simple_factory/OperationSub.hpp"
#include "exception/CustomException.hpp"

enum OperationType {
    Add,
    Sub
};

class OperationFactory
{
public:
    OperationFactory(/* args */) = default;
    ~OperationFactory() = default;

    static IOperation_ptr CreateOperation(OperationType op) {
        switch(op) {
            case Add:
                return std::make_shared<OperationAdd>();
            case Sub:
                return std::make_shared<OperationSub>();
            default:
                ThrowCustomExceptionInstance("Method not supported");
        }
    }
};
